<?php
require '../vendor/autoload.php';
$hosts = [
    '101.132.73.77:9200' // ip和端口
];

$client = Elasticsearch\ClientBuilder::create()
                                ->setHosts($hosts)
                                ->build();

   $params = [
       'index' => 'one',
       'type' => '_doc',
       'id' => '1',
       'body' => ['testField' => 'abc']
    ];

$response = $client->index($params);
print_r($response);
